package com.tender.controller;

import com.tender.service.RedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.tender.constants.Constant;

@RestController
@RequestMapping("/redis")
public class RedisController {


    @Autowired
    private RedisService redisService;

    @GetMapping("/get")
    public String getRedisValue() {
        return redisService.get(Constant.KEY);
    }

    @GetMapping("/set")
    public String set() {
        redisService.set(Constant.KEY, 1000 + "");
        return "success";
    }

}
